<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var number = 10
      // ++number  先 +1 ,再返回
      // document.write(++number) // 11
      // console.log(number) //11

      // number++ 先返回，再 +1
      document.write(number++) // 10
      console.log(number) // 11

      var sum = 10
      // ++sum  先 -1 ,再返回
      // document.write(--sum) // 9
      // console.log(sum) //9

      // sum-- 先返回，再 -1
      document.write(sum--) // 10
      console.log(sum) // 9
    </script>
  </body>
</html>
